# -*- coding: utf-8 -*-
"""
Created on Wed May 18 19:25:24 2022

@author: Administrator
"""
from typing import List

class Solution:
    def setZeroes(self, matrix: List[List[int]]) -> None:
        """
        Do not return anything, modify matrix in-place instead.
        """
        m, n = len(matrix), len(matrix[0])
        res = []
        for row in range(m):
            for col in range(n):
                if matrix[row][col] == 0:
                    res.append([row, col])
        for cor in res:
            for i in range(m):
                matrix[i][cor[1]] = 0
            for j in range(n):
                matrix[cor[0]][j] = 0
        return matrix

matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
solution = Solution()
res = solution.setZeroes(matrix)
